<template>
  <div class="">count {{ count }} double count {{ doubleCount }}</div>
</template>

<script lang="ts" setup>
import { reactive, ref, computed } from 'vue'

type Book = {
  name: string
  price?: number
  publicName: string
}

const book: Book = reactive({
  name: '十万个不为什么',
  price: 80,
  publicName: '新华出版社'
})

const count = ref(100)

// const doubleCount = computed<number>(() => {
//   return count.value * 2
// })

// 如果computed不写泛型，也可以根据 return 推断出来
const doubleCount = computed(() => {
  return count.value * 2
})
</script>

<style scoped></style>
